combit List & Label 29 - .NET Help
Programming Introduction / Other Important Concepts / Edit and Extend the Designer
In This Topic
    Edit and Extend the Designer
    In This Topic

    The Designer is not a "Black Box” for the application, but can be manipulated in many ways. Besides disabling functions and menu items, user-specific elements can be added that move calculations, actions or outputs to the function logic.

     

     

    Menu Items, Objects and Functions

    Starting point for Designer restrictions is the DesignerWorkspace property of the ListLabel object. In the following table the properties listed can be used to restrict the Designer:

    Property Function
    ProhibitedActions This property's purpose is to remove single menu items from the Designer.
    ProhibitedFunctions This property's purpose is to remove single functions from the Designer.
    ReadOnlyObjects This property's purpose is to prevent objects' editability in the Designer. The objects are still visible; however they can't be edited or deleted within the Designer.

    The following example shows how the Designer can be adjusted so no new project can be created. In addition the function ProjectPath$ will be removed and the object "Demo” is prevented from being edited:

    ListLabel LL = new ListLabel();
    LL.DataSource = CreateDataSet();
    
    LL.DesignerWorkspace.ProhibitedActions.Add(LlDesignerAction.FileNew);
    LL.DesignerWorkspace.ProhibitedFunctions.Add("ProjectPath$");
    LL.DesignerWorkspace.ReadOnlyObjects.Add("Demo");
    
    LL.Design();
    LL.Dispose();
    
    Dim LL As New ListLabel()
    LL.DataSource = CreateDataSet()
    
    LL.DesignerWorkspace.ProhibitedActions.Add(LlDesignerAction.FileNew)
    LL.DesignerWorkspace.ProhibitedFunctions.Add("ProjectPath$")
    LL.DesignerWorkspace.ReadOnlyObjects.Add("Demo")
    
    LL.Design()
    LL.Dispose()
    

     

    Extend Designer

    The Designer can be extended by user-specific functions (DesignerFunctions), objects (DesignerObjects) and actions (DesignerActions). User-specific functions can be used to move more complex calculations to the application or add functions which are not covered by the Designer by default. Examples for own objects or actions as well as another own function are shown in the .NET sample Designer Extension Sample.

     

    Register Languages in Designer

    Different languages can be registered in the Designer, so that project files can be easily localized later. Localization of Project Files in Designer shows how the translations can be done. Here the three languages English, German and French are registered and can be changed by the user later in Designer simply in the menu:

                    
    // Define LCIDs
    int designerLanguageLCIDen = new CultureInfo("en").LCID;
    int designerLanguageLCIDde = new CultureInfo("de").LCID;
    int designerLanguageLCIDfr = new CultureInfo("fr").LCID;
    
    // Add/declare the available design languages
    // according to their respective LCID
    LL.DesignerWorkspace.DesignerLanguages.Add(designerLanguageLCIDde);
    LL.DesignerWorkspace.DesignerLanguages.Add(designerLanguageLCIDen);
    LL.DesignerWorkspace.DesignerLanguages.Add(designerLanguageLCIDfr);
    
                    
    ' Define LCIDs
    Dim designerLanguageLCIDen As Integer = New CultureInfo("en").LCID
    Dim designerLanguageLCIDde As Integer = New CultureInfo("de").LCID
    Dim designerLanguageLCIDfr As Integer = New CultureInfo("fr").LCID
    
    ' Add/declare the available design languages
    ' according to their respective LCID
    LL.DesignerWorkspace.DesignerLanguages.Add(designerLanguageLCIDde)
    LL.DesignerWorkspace.DesignerLanguages.Add(designerLanguageLCIDen)
    LL.DesignerWorkspace.DesignerLanguages.Add(designerLanguageLCIDfr)